//
//  SMyView.m
//  News
//
//  Created by dlios on 15-5-13.
//  Copyright (c) 2015年 PEAK. All rights reserved.
//

#import "SMyView.h"

@implementation SMyView


- (void)dealloc
{
    [_myLabel release];
    [_myTextField release];
    [super dealloc];
}
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        [self jianli];
    }
    return self;
}
- (void)jianli
{
    //创建label
    self.myLabel = [[UILabel alloc] initWithFrame:CGRectMake(20, 20, 100, 40)];
    //self.myLabel.backgroundColor = [UIColor orangeColor];
    [self addSubview:self.myLabel];
    [_myLabel release];
    
    
    
    //创建textField
    self.myTextField = [[UITextField alloc] initWithFrame:CGRectMake(140, 20, 200, 40)];
    self.myTextField.borderStyle = UITextBorderStyleRoundedRect;
    self.myTextField.delegate = self;
    [self addSubview:self.myTextField];
    [_myTextField release];
}
- (BOOL)textFieldShouldReturn:(UITextField *)textField
{
    [textField resignFirstResponder];
    return YES;
}


/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
